# -*- coding:utf-8 -*-
import time

from spider.common.util.SeleniumUtils import SeleniumUtils

chrome_path = r"D:\software\chrome\chrome-win64\chrome.exe"  # 替换为你的Chrome路径
url="https://www.baidu.com"

if __name__ == "__main__":

    seleniumUtils=SeleniumUtils(chrome_path=chrome_path,headless_flag=False)
    seleniumUtils.open_url(URL=url,max_value=5)
    Drivers=seleniumUtils.get_brower()
    input = Drivers.find_element_by_id('kw')  # 找到搜索输入框
    input.send_keys("小米")  # 输入搜索关键词
    Drivers.find_element_by_id('su').click()  # 点击搜索按钮

    # 设置五秒后执行下一步
    time.sleep(5000)
    # 关闭浏览器
    seleniumUtils.quit()